"DESCRIPTION 1"="To remind yourself that you are running a full screen DOS session from you can use this plug-in."
"DESCRIPTION 2"="The second statement line is what you'll see as prompt during your DOS session (Windows DOS box), and you won't forget to go back to Windows when you're done working/playing in DOS."
"DESCRIPTION 3"="Example DOS Prompt:"
"DESCRIPTION 4"="MS-DOS Mode!$_$P$G"
"DESCRIPTION 5"="Example Windows Prompt:"
"DESCRIPTION 6"="Type EXIT & hit ENTER to return to Windows!$_$P$G"
"AUTHOR"="Xteq Systems"
"CONTACTURL"="http://www.xteq.com"
"COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
"COMMENT 1"="Thanks to AXCEL216 for this tip."
'Declaration of some constants
sF="C:\AUTOEXEC.BAT"
sV1="SET PROMPT="
sV2="SET WINPMT="
'Called when the Plugin is started
Sub Plugin_Initialize
Call FileSetAttribute(sF,"R-")
Call FileSetAttribute(sF,"H-")
TxtOpen(sF)
i=TxtFindLine(sV1,false) 'search for first prompt, ignoring case
if i>0 then
s=TxtGetLine(i)
'strip out the part after the "="
i=InStr(s,"=") 'find where "=" appears
s=Right(s,len(s)-i) 'extract the part after the "="
Call SetUIElement(1,s) 'finally, set inside UI
else
Call SetUIElement(1,"$p$g") ' use default if nothing is there
end if
i=TxtFindLine(sV2,false) 'search for second prompt, ignoring case
if i>0 then
s=TxtGetLine(i)
'strip out the part after the "="
i=InStr(s,"=") 'find where "=" appears
s=Right(s,len(s)-i) 'extract the part after the "="
Call SetUIElement(2,s) 'finally, set inside UI
else
Call SetUIElement(2,"$p$g") ' use default if nothing is there
end if
End Sub
'Called when the Plugin should validate the Data the user has entered
Sub Plugin_CheckData(ElementIndex)
End Sub
'Called when the Plugin should apply the changes
Sub Plugin_Apply(ElementIndex,ElementSubIndex)
s=GetUIElement(1)
i=TxtFindLine(sV1,false) 'search for second prompt, ignoring case
Call TxtSetLine(i,sV1 & s) 'write to file
s=GetUIElement(2)
i=TxtFindLine(sV2,false) 'search for second prompt, ignoring case
Call TxtSetLine(i,sV2 & s) 'write to file
Call FileBackup(sF) 'backup file
Call TxtSave() 'save file
End Sub
'Called when the Plugin is about to be removed from memory